package com.lupengning.es.test.doc;

import java.io.IOException;
import org.apache.http.HttpHost;
import org.elasticsearch.action.delete.DeleteRequest;
import org.elasticsearch.action.delete.DeleteResponse;
import org.elasticsearch.client.RequestOptions;
import org.elasticsearch.client.RestClient;
import org.elasticsearch.client.RestHighLevelClient;

public class ESTest_Doc_Delete {

  public static void main(String[] args) throws IOException {
    RestHighLevelClient esClient = new RestHighLevelClient(
        RestClient.builder(new HttpHost("192.168.56.10", 9200, "http"))
    );

    DeleteResponse response = esClient.delete(new DeleteRequest("user","1001"), RequestOptions.DEFAULT);

    System.out.println(response.getResult());
    esClient.close();
  }
}
